<?php 
// load the error handling module 
require_once('error_handler.php'); 
require_once('friendly.class.php'); 
// make sure the user's browser doesn't cache the result 
header('Expires: Wed, 23 Dec 1980 00:30:00 GMT'); // time in the past 
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); 
header('Cache-Control: no-cache, must-revalidate'); 
header('Pragma: no-cache'); 
// read the action parameter 
$action = $_GET['action']; 
// get news 
if ($action == 'GetNews') 
{ 
  // create new instance of the Friendly class 
  $friendly = new Friendly(); 
  // use Friendly functionality to retrieve the news message 
  $news = $friendly->getNews(); 
  // echo the message to be read by the client 
  echo $news; 
} 
else 
{ 
  echo 'Communication error: server doesn\'t understand command.'; 
} 
?> 